// // 高精度加法
// function add(a, b) {
//   let i,
//     k = 0,
//     cur = 0;
//   var c = [];
//   const maxlen = Math.max(a.length, b.length);
//   // 补0, 统一长度
//   a = String.prototype.padStart.apply(a, [maxlen, "0"]);
//   b = String.prototype.padStart.apply(b, [maxlen, "0"]);

//   // console.log(a, b);
//   for (i = maxlen - 1; i >= 0; i--) {
//     const sum = parseInt(a[i]) + parseInt(b[i]) + k;
//     c[cur++] = sum >= 10 ? ((k = 1), sum - 10) : ((k = 0), sum);
//   }
//   if (k == 1) c[cur] = 1;
//   return c.reverse().join("");
// }

// var a =
//   "100000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000888";
// var b = "1150";
// console.log(add(a, b));


// 
const num1 = "12488591031095917289124885910310959172"
const num2 = "32481239839485789343248123983948578934"
let sum = BigInt(num1) + BigInt(num2)
sum = sum + ''
console.log('sum =', sum);


async function async1() {
    console.log('async1 start');
    await async2();
    console.log('async1 end');
  }
  async function async2() {
    await async3()
    console.log('async2');
  }
  
  async function async3() {
    console.log('async3');
  }
  
  console.log('script start');
  setTimeout(function() {
      console.log('setTimeout');
  }, 10);
  
  async1();
  new Promise(function(resolve) {
      console.log('promise1');
      resolve();
    }).then(function() {
      console.log('promise2');
  });
  console.log('script end');


  // script start
  // async1 start
  // async3
  // promise1
  // script end
  // async2
  // async1 end
  // promise2
  // setTimeout